# 用户名、密码、黑名单

# dict
account = {
    "jack": {"name": "jack", "password": "123", "status": True},
    "mary": {"name": "mary", "password": "456", "status": True},
    "tom": {"name": "tom", "password": "789", "status": False}  # 黑名单
}
print(type(account))

for j in range(3):
    user = input("用户名：")
    pwd = input("密码：")
    # 用户存在，密码正确，不在黑名单
    if user in account and pwd == account[user]['password'] and account[user]['status']:
        print("登录成功")
        break
    elif user in account and not account[user]['status']:
        print("该用户在黑名单内，请联系管理员")
    elif user in account and pwd != account[user]['password']:
        print("密码错误，请重试")
    else:  # break没有执行过
        print("用户名不存在，请先jack注册")
